package abstractEntities;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;

import entities.Departament;
import entities.Language;
import entitiesIds.LanguagedepartmentId;

/**
 * AbstractLanguagedepartment entity provides the base persistence definition of
 * the Languagedepartment entity. @author MyEclipse Persistence Tools
 */
@MappedSuperclass
public abstract class AbstractLanguagedepartment implements
		java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 3812815793765948749L;
	private LanguagedepartmentId id;
	private Departament departament;
	private Language language;
	private String topic;
	private String info;

	// Constructors

	/** default constructor */
	public AbstractLanguagedepartment() {
	}

	/** full constructor */
	public AbstractLanguagedepartment(LanguagedepartmentId id,
			Departament departament, Language language, String topic,
			String info) {
		this.id = id;
		this.departament = departament;
		this.language = language;
		this.topic = topic;
		this.info = info;
	}

	// Property accessors
	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "idDepartament", column = @Column(name = "idDepartament", nullable = false)),
			@AttributeOverride(name = "abb", column = @Column(name = "abb", nullable = false, length = 5)) })
	public LanguagedepartmentId getId() {
		return this.id;
	}

	public void setId(LanguagedepartmentId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idDepartament", nullable = false, insertable = false, updatable = false)
	public Departament getDepartament() {
		return this.departament;
	}

	public void setDepartament(Departament departament) {
		this.departament = departament;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "abb", nullable = false, insertable = false, updatable = false)
	public Language getLanguage() {
		return this.language;
	}

	public void setLanguage(Language language) {
		this.language = language;
	}

	@Column(name = "topic", nullable = false)
	public String getTopic() {
		return this.topic;
	}

	public void setTopic(String topic) {
		this.topic = topic;
	}

	@Column(name = "info", nullable = false, length = 3000)
	public String getInfo() {
		return this.info;
	}

	public void setInfo(String info) {
		this.info = info;
	}

}